Release 10.1A: OpenEdge Development:
Java Open Clients


Asking for permission in Microsoft Internet Explorer

Asking for permission in Internet Explorer requires that you add specific code to your applet.

To add a code to your applet:

  1. Down load the security classes for Microsoft, by putting the security classes on your CLASSPATH and adding the following import statement to your applet code:
  2. import com.ms.security.*; 
    

    Note: The Microsoft security classes are not available as a standalone package. You can get these security classes by downloading the latest Microsoft Java SDK from http://www.microsoft.com.

  3. Insert the following code into your applet, just before creating your Java proxy AppObject:
  4. // Assert Net IO privileges 
    try 
    { 
          if (Class.forName("com.ms.security.PolicyEngine") != null) 
              PolicyEngine.assertPermission(PermissionID.NETIO); 
    }catch(ClassNotFoundException e) 
    { 
          System.out.println("IE Security Manager not found"); 
    } 
    

    This code searches for the class com.ms.security.PolicyEngine. When the class is found, the code calls the static method assertPermission, asking for NETIO permission. This method verifies that the user selected yes in the security dialog box when the applet was downloaded. If yes was selected, the user can connect to the AppServer.

    With Microsoft Internet Explorer, a user is prompted only once when the code is first downloaded.

  5. If you use HTTPS, you also might need to obtain file I/O privileges from the Microsoft VM security system to read the files containing the root digital certificates. If this is the case, add the following line to your code, after the line of code that request NETIO privileges:
  6. PolicyEngine.assertPermission(PermissionID.FILEIO); 
    

    Permissions are valid only for a particular method call; that is why you should insert this code just before constructing your Java proxy AppObject. For instance, if you put this code in its own method, you would no longer have the permission when your method returns.

    For more information on Microsoft's trust based security model, see the Microsoft SDK for Java documentation.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095